{extend name="layout:base" /}
{block name="page_content"}
  <div class="row maintop">
    <div class="col-xs-12">
      <form name="form_search" class="form-search form-inline" method="get" action="{:url('index')}">
        <div class="form-group">
          <label>短信类型：</label>
          <select name="message_type" class="form-control">
            <option value="">请选择类型</option>
            <?php $type_lists = list_field_sms_type(); ?>
            {volist name="type_lists" id="type_name"}
              <?php if(isset($param['message_type']) && $param['message_type']==$key): ?>
                <option value="{$key}" selected="selected">{$type_name}</option>
              <?php else: ?>
                <option value="{$key}">{$type_name}</option>
              <?php endif; ?>
            {/volist}
          </select>
        </div>
        <div class="form-group">
          <label>是否成功：</label>
          <select name="is_response" class="form-control">
            <option value="">显示所有</option>
            <?php $s_lists = list_field_success(); ?>
            {volist name="s_lists" id="s_item"}
              <?php if(isset($param['is_response']) && $param['is_response']!='' && $param['is_response']==$key): ?>
                <option value="{$key}" selected="selected">{$s_item}</option>
              <?php else: ?>
                <option value="{$key}">{$s_item}</option>
              <?php endif; ?>
            {/volist}
          </select>
        </div>
        <div class="form-group">
          <label>关键词：</label>
          <div class="input-group">
            <span class="input-group-addon">
              <i class="ace-icon fa fa-check"></i>
            </span>
            <input type="text" name="keyword" id="keyword" class="form-control" value="{$param.keyword|default=''}" placeholder="请输入关键词" />
            <span class="input-group-btn">
              <button type="submit" class="btn btn-purple btn-sm">
                <span class="ace-icon fa fa-search icon-on-right bigger-110"></span>
                搜索
              </button>
            </span>
            </a>
          </div>
        </div>
        <div class="form-group">
          <a href="{:url('index')}" class="btn btn-sm  btn-purple ml-10">
            <span class="ace-icon fa fa-globe icon-on-right bigger-110"></span>
            显示全部
          </a>
        </div>
      </form>
    </div>
  </div>

  <div class="row">
    <div class="col-xs-12">
      <form method="post" action="{:url('resort')}" >
        <table class="table table-striped table-bordered table-hover" id="dynamic-table">
          <thead>
            <tr>
              <th>ID</th>
              <th>手机号码</th>
              <th>短信类型</th>
              <th>发送是否成功</th>
              <th>发送时间</th>
            </tr>
          </thead>
          <tbody>
            <?php $list = $res->all(); ?>
            {volist name="$list" id="vo"}
              <tr>
                <td class="field-style center">
                  <a href="{:url('read', ['id' => $vo['id']])}">{$vo.id}</a>
                </td>
                <td>
                  {$vo.mobile}
                </td>
                <td>
                  {$vo.message_type|get_field_text='sms_type',###}
                </td>
                <td>
                  {$vo.is_response|get_field_text='success',###}
                </td>
                <td class="center">
                  {$vo.create_time}
                </td>
              </tr>
            {/volist}
          </tbody>
        </table>
        <div class="row">
          <div class="col-xs-12">
            <?php echo($res->render()); ?>
          </div>
        </div>
      </form>
    </div>
  </div>
{/block}